import React from 'react'
import { Tabs } from 'antd'
import { messageSettingsContext } from './context'
import store from './hooks/hook'
import style from './index.module.less'
import MessagePush from './components/messagePush/intex'
import HistoryPush from './components/historyPush/index'
// 模板管理的页面，暂时不做
import TemplateAdmin from './components/templateAdmin/index'

export default () => {
  const storeData = store()

  return (
    <messageSettingsContext.Provider value={storeData}>
      <div className={style.messageSettingsBox}>
        <Tabs
          defaultActiveKey='1'
          onChange={storeData.messagePushConfig.tabsChangeClick}
          items={[
            {
              label: '消息推送',
              key: '1',
              children: <MessagePush />,
            },
            {
              label: '历史推送',
              key: '2',
              children: <HistoryPush />,
            },
            {
              label: '模板管理',
              key: '3',
              children: <TemplateAdmin />,
            },
          ]}
        />
      </div>
    </messageSettingsContext.Provider>
  )
}
